﻿using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace GMS.API.Controllers
{
    [ApiController]
    [Authorize]
    [Route("Operator")]
    public class OperatorController : ControllerBase
    {
        [HttpPost("img")]
        public IActionResult PostImg(IFormFile file)
        {
            var stream = file.OpenReadStream();
            var bytes = new byte[stream.Length];
            stream.Read(bytes, 0, bytes.Length);
            return new FileContentResult(bytes, "image/jpeg");
        }
    }
}